<extend name="Base/base" />
<block name='head'>
    <style>
        .total{text-align: left;font-size:16px;font-weight: bold;color:#CE272D;margin-top:30px}
    </style>
</block>
<block name="content"> 
    <section class="larry-wrapper">
        <!--<p class="nav-title"><span>缺勤信息</span></p>-->
        <!--第一部分-->
        <div class="row page-inquire">
            <div class="col-lg-12 col-sm-12">	
                <form class="form" method="get" action="{:U('checkGoods')}">
                    <div class="layui-row">
                        <div class="layui-inline">
                            <label class="layui-form-label">盘点方式：</label>
                            <div class="layui-input-inline">
                                <select class="layui-input search_input" name="mode" style="min-width: 120px;">
                                    <option value="0" {$mode == 0 ? 'selected' : ''}>物品盘点</option>
                                    <option value="1" {$mode == 1 ? 'selected' : ''}>入库盘点</option>
                                    <option value="2" {$mode == 2 ? 'selected' : ''}>出库盘点</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">类别：</label>
                            <div class="layui-input-inline">
                                <select class="layui-input search_input" name="type" style="min-width: 120px;">
                                    <option value="0" {$type == 0 ? 'selected' : ''}>全部</option>
                                    <option value="1" {$type == 1 ? 'selected' : ''}>信息化产品</option>
                                    <option value="2" {$type == 2 ? 'selected' : ''}>低值易耗品</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline time" style="display:none">
                            <label class="layui-form-label">时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" placeholder="开始时时" name="start" value='{$start}' class="layui-input datepickerInput">    
                            </div>
                            <div class="layui-input-inline">至</div>
                            <div class="layui-input-inline">
                                <input type="text" placeholder="结束时间" name="end" value='{$end}' class="layui-input datepickerInput">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <a class="layui-btn search_btn search">查询</a>
                        </div>
                    </div>
                </form>
                <div class="layui-row">
                    <table class="layui-table setTabBg" lay-skin="line">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>物品名称</th>
                                <th>型号</th>
                                <th>单位</th>
                                <th>金额</th>
                        <if condition="$mode eq 0">
                            <th>期初库存</th>
                        </if>
                        <if condition="$mode neq 2">
                            <th>入库</th>
                        </if>
                        <if condition="$mode neq 1">
                            <th>出库</th>
                        </if>
                        <if condition="$mode eq 0">
                            <th>期末库存</th>
                        </if>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="goods" item="row">
                            <tr>
                                <td>{$row.id}</td>
                                <td>{$row.name}</td>
                                <td>{$row.model}</td>
                                <td>{$row.unit}</td>
                                <td>{$row.price}</td>
                            <if condition="$mode eq 0">
                                <td>{$row.begin_balance}</td>
                            </if>
                            <if condition="$mode neq 2">
                                <td>{$row.put}</td>
                            </if>
                            <if condition="$mode neq 1">
                                <td>{$row.out}</td>
                            </if>
                            <if condition="$mode eq 0">
                                <td>{$row.final_balance}</td>
                            </if>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <if condition="$mode eq 1">
                        <p class="total">入库合计：{$total}</p>
                        <elseif condition="$mode eq 2"/>
                        <p class="total">出库合计：{$total}</p>
                    </if>
                </div>
            </div>
        </div>
        <div class="larry-table-page clearfix">
            <div id="page" class="page">{$page}</div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/goods.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(initGoods());
        $(dateTime(0));

    </script>    
</block>

